package main

import "fmt"

type Node struct {
   Val int
   Children []*Node
}

// 递归 - 前序遍历
func preOrder(root *Node) {
   if root == nil {
      return
   }
   fmt.Println(root.Val)
   for _, child := range root.Children {
      preOrder(child)
   }
}

// 递归 - 前序遍历
func postOrder(root *Node) {
   if root == nil {
      return
   }
   for _, child := range root.Children {
      postOrder(child)
   }
   fmt.Println(root.Val)
}
